<?php
if (!defined("_ECRIRE_INC_VERSION")) return;
global $tables_principales;

function radiodj_declarer_tables_interfaces($interface){
    $interface['tables_jointures']['spip_auteurs']['id_auteur']= 'radiodj_schedule'; // Этот join почемуто не сработал    
    $interface['tables_jointures']['spip_rubriques']['id_rubrique']= 'radiodj_programs_schedule';
    
    $interface['table_des_tables']['radiodj_schedule']='radiodj_schedule';    
    $interface['table_des_tables']['radiodj_programs_schedule']='radiodj_programs_schedule';
	return $interface;
}

function radiodj_declarer_tables_principales($tables_principales){    
    
    //------ Table "spip_radiodj_schedule" ------
    // Define table 
	$spip_radiodj_schedule = array(
		"id_schedule" => "BIGINT(21) NOT NULL auto_increment",
	    "day" => "TINYINT(1) NOT NULL",
	    "time_begin" => "TIME NOT NULL",
	    "time_end" => "TIME NOT NULL",
        "id_auteur" => "BIGINT(21) NOT NULL",
        "expires" => "DATETIME DEFAULT NULL",
	    );

	// Define keys
	$spip_radiodj_schedule_key = array(
		"PRIMARY KEY" => "id_schedule");

	// Add table to the database
	$tables_principales['spip_radiodj_schedule'] = array(
		'field' => &$spip_radiodj_schedule,
		'key' => &$spip_radiodj_schedule_key);
    //-------------------------------------------
    
    //------ Table "spip_radiodj_programs_schedule" ------
    // Define table 
	$spip_radiodj_programs_schedule = array(
		"id_programs_schedule" => "BIGINT(21) NOT NULL auto_increment",
	    "day" => "TINYINT(1) NOT NULL",
	    "time_begin" => "TIME NOT NULL",
	    "time_end" => "TIME NOT NULL",
        "id_rubrique" => "BIGINT(21) NOT NULL",
	    );

	// Define keys
	$spip_radiodj_programs_schedule_key = array(
		"PRIMARY KEY" => "id_programs_schedule");

	// Add table to the database
	$tables_principales['spip_radiodj_programs_schedule'] = array(
		'field' => &$spip_radiodj_programs_schedule,
		'key' => &$spip_radiodj_programs_schedule_key);
    //-------------------------------------------    
        		
	return $tables_principales;
}

?>